<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});


// 假设你的前端静态资源位于public_html/dist
Route::get('/dist/{path:.*}', function ($path) {
    $filePath = __DIR__ . '../dist/' . $path;

    if (file_exists($filePath)) {
        return send_file($filePath);
    } else {
        // 文件不存在的处理逻辑，比如返回404或者其他页面
        http_response_code(404);
        return 'File not found.';
    }
});
